﻿using System;
using Kiva7.Utilities;
using Kiva7.DataResponse;
using Kiva7.DataClasses;

namespace Kiva7.DataRequests
{
    public class LoanUpdatesRequest : DataRequest<LoansResponse, Loan>
    {
        public LoanUpdatesRequest()
            : base(true, true)
        {
        }


        public Uri BuildUri(int loanId)
        {
            UrlCreator url = new UrlCreator(string.Format(BaseUrl + "loans/{0}/updates.xml", loanId));

            url.Add("app_id", KivaAppId);

            return url.ToUri();
        }


        internal void GetLoan(int loanId)
        {
            LoadResponse(BuildUri(loanId));
        }
    }

}
